package com.cloudsigns.factorymanager2.project.utils;

import com.cloudsigns.factorymanager2.project.bean.ProductBean;

import java.util.HashMap;
import java.util.List;

/**
 * 产品信息Util
 * Created by tony on 2017/12/9.
 */

public class ProductInfoUtil {
    private static ProductInfoUtil instance;

    /*一张工程单 对应的所有产品集*/
    HashMap<Long, List<ProductBean>> productMap = new HashMap<>();

    public static ProductInfoUtil getInstance() {
        if (instance == null)
            instance = new ProductInfoUtil();

        return instance;
    }

    public void addProductInfo(long engineeringOrderId, ProductBean productBean) {
        List productBeanList = productMap.get(engineeringOrderId);
        if (productBeanList != null) {
            productBeanList.add(productBean);
        }
    }
}
